<template>
  <div class="a">
    <MyHeader :title="title"></MyHeader>
    <MyGoods v-for="item in list" :key="item.id" :goods="item"></MyGoods>
    <MyFooter :list="list"></MyFooter>
  </div>
</template>

<script>
import MyHeader from "./components/MyHeader.vue";
import MyGoods from "./components/MyGoods.vue";
import MyFooter from "./components/MyFooter.vue";
export default {
  components: {
    MyHeader,
    MyGoods,
    MyFooter,
  },

  data() {
    return {
      title: "购物车",
      list: [],
  
    };
  },
  created() {
    this.$axios({
      method: "get",
      url: "/api/cart",
    }).then(({ data: res }) => {
      this.list = res.list;
     
    });
  },
  mounted() {},

  methods: {},
};
</script>

<style lang="less" scoped>
.a {
  padding: 45px 0 50px 0;
}
</style>